﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QianBuo.Lottery.Web.Models.ChaseTask.ChaseDetailModel>" %>
<%@ Import Namespace="Code.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	追号任务详情
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<fieldset>
    <legend>追号任务详情</legend>
    <div class="div_ChaseDetail">
        <div>
        <table class="table" width="100%">
            <tr class="th"><td colspan="8" align="left">追号任务详情</td></tr>
            <tr>
                <td align="right">追号用户：</td>
                <td align="left"><%=Model.ChaseTask.UserName %></td>
                <td align="right">购买日期：</td>
                <td align="left"><%=Model.ChaseTask.AddTime.ToString("yyyy-MM-dd HH:mm:ss")%></td>
                <td align="right">彩种：</td>
                <td align="left"><%=Model.ChaseTask.LotteryType.GetName()%></td>
                <td align="right">元角模式：</td>
                <td align="left"><%=Model.ChaseTask.RatioName%></td>
            </tr>
            <tr>
                <td align="right">追号总期数：</td>
                <td align="left"><%=Model.ChaseTask.ChaseCount%></td>
                <td align="right">执行期数：</td>
                <td align="left"><%=Model.ChaseTask.ExecuteCount%></td>
                <td align="right">撤销期数：</td>
                <td align="left"><%=Model.ChaseTask.CancleCount%></td>
                <td align="right">奖金模式：</td>
                <td align="left"><%=Model.ChaseTask.WinModelName%></td>
            </tr>
            <tr>
                <td align="right">任务金额：</td>
                <td align="left"><%=Model.ChaseTask.TaskMoney.ToString("F")%></td>
                <td align="right">任务状态：</td>
                <td align="left"><%=Model.ChaseTask.State.GetName()%></td>
                <td align="right">中奖后中止：</td>
                <td align="left"><%=Model.ChaseTask.StopWin >= 0 ? "是" : "否"%></td>
                <td align="right">终止时间:</td>
                <td align="right"><%=string.Format("{0:yyyy-MM-dd HH:mm:ss}",Model.ChaseTask.StopTime)%></td>
            </tr>
            <tr>
                <td align="right">操作：</td>
                <td align="left" colspan="7">
                   <%=Model.ChaseTask.State == ChaseTaskState.Normal ? Html.ActionLink("撤消", "QuashChaseTask", Url.Route(new { Model.ChaseTask.ID, returnurl = Request.RawUrl }), Url.Route(new { @class = "a_blue", onclick = "return confirm('确定要撤销此任务吗？')" })) : MvcHtmlString.Empty%>
                </td>
            </tr>
        </table>
        </div>
        <div class='div_ChaseChoseNumber'>
        <%Html.RenderAction("NumberList", Url.Route(new { str=Model.ChaseTask.ChooseNumber})); %>
        </div>
        <p />
        <table class="table" width="100%">
            <tr class="th">
                <th>期号</th><th>金额</th><th>倍数</th><th>状态</th><th>开奖号码</th><th>操作</th>
            </tr>
            <%var i = 0; foreach (var item in Model.DetailList)%>
            <% { %>
            <tr <%=i++%2==1?"class='supersede'":"" %> id='tr_<%=i %>'>
                <td><%=item.IssueNumber%></td>
                <td><%=item.Money%></td>
                <td><%=item.Multiple%></td>
                <td class='td_<%=i %>'><%=item.State==(short)ChaseTaskState.Normal?"正在进行":((ChaseTaskState)item.State).GetName()%></td>
                <td><%=item.OpenCode %></td>
                <td>
                    <%if (item.State == (short)ChaseTaskState.Normal)
                        { %>
                        <label style=" cursor:pointer;" onclick="QuashChaseOrder('<%=Url.Action("QuashChaseOrder",new {ID=item.ID}) %>',<%=i %>,this)" class="a_blue">撤消</label>
                    <%}else if(item.State==(short)ChaseTaskState.Executed){%>
                        <%=Html.ActionLink("查看", "HistoryDetail", "Scheme", new {item.SchemeID,ReturnUrl=Request.RawUrl,act="Detail",cont="ChaseTask" }, new { @class="a_blue"})%>
                    <%} %>
                </td>
            </tr>
            <% }%>
            <% var page = Model.pageInfo; %>
            <% if (page != null) %>
            <% { %>
            <tr>
                <td colspan="6">
                    <%=Html.Pager(page.CurrPage, page.PageCount, page.SunCount, "pageInfo.CurrPage", Url.Route(new { Model.Search, Model.ChaseModelCurrenPage,Model.ChaseID }), "pageInfo.PageCount")%>
                </td>
            </tr>
            <%} %>
        </table>
        <p></p>
        <a href='<%=Request["ReturnUrl"]??Url.Action("Index", Url.Route(new { Model.Search, pageInfo = new { CurrPage = Model.ChaseModelCurrenPage } })) %>' class="a_blue">&gt;&gt;返回</a>
        </div>
</fieldset>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="StyleAndScript" runat="server">
<script type="text/javascript">
    function QuashChaseOrder(url, index, obj) {
        if (confirm('您确定要撤消当前期的追号？')) {
            var td = $('.div_ChaseDetail #tr_' + index + ' .td_' + index);
            Site.getJSON(url, null, function (successData) {
                if (successData.Msg.length)
                    alert(successData.Msg);
                if (successData.Result > 0) {
                    td.text('<%=ChaseTaskState.UserCancel.GetName() %>');
                    obj.style.display = 'none';
                }
            });
        }
    }
</script>
</asp:Content>
